import $axios from "../utils/request";

// account模块
export const $accountAdd = (data) => {
  return $axios.post("/account/add", data);
};
export const $accountList = () => {
  return $axios.get("/account/list");
};
export const $accountLogin = (params) => {
  return $axios.post("/account/login", params);
};
export const $accountDel = (data = {}) => {
  return $axios.post("/account/del", data);
};

// security模块
export const $securityAdd = (data) => {
  return $axios.post("/security/add", data);
};
export const $securityList = () => {
  return $axios.get("/security/list");
};
export const $securityEdit = (data = {}) => {
  return $axios.post("/security/edit", data);
};
export const $securityDel = (data = {}) => {
  return $axios.post("/security/del", data);
};

// sensor模块
export const $sensorAdd = (data) => {
  return $axios.post("/sensor/add", data);
};
export const $sensorList = (params) => {
  return $axios.get("/sensor/list", { params });
};
export const $sensorDel = (data = {}) => {
  return $axios.post("/sensor/del", data);
};
export const $sensorCount = () => {
  return $axios.get("/sensor/count");
};
export const $sensorChangGroup = (params) => {
  return $axios.get("/sensor/changeGroup", { params });
};

// device设备
export const $deviceCount = () => {
  return $axios.get("/device/count");
};
export const $deviceSensorList = () => {
  return $axios.get("/device/sensorList");
};
export const $devicegatewayList = (params = {}) => {
  return $axios.get("/gateway/list", { params });
};
export const $devicegroupList = (params = {}) => {
  return $axios.get("/group/list", { params });
};
export const $deviceaddList = (params = {}) => {
  return $axios.get("/group/add", { params });
};
export const $devicdelList = (params = {}) => {
    return $axios.get("/group/del", { params });
  };
  export const $deviceditList = (params = {}) => {
    return $axios.post("/group/edit", params );
  };

// 计费模块
export const $feeAdd = (data = {}) => {
  return $axios.post("/fee/recharge", data); // 充值
};
export const $feeDel = (data = {}) => {
  return $axios.post("/fee/del", data);
};
export const $feeEdit = (data = {}) => {
  return $axios.post("/fee/edit", data);
};
export const $feeBalance = (params = {}) => {
  return $axios.get("/fee/balance", { params });
};
export const $feeRechargeList = (params = {}) => {
  return $axios.get("/fee/rechargeList", { params }); // 充值记录
};
export const $feeusageList = (params = {}) => {
  return $axios.get("/fee/usageList", { params }); // 充值记录
};
//测量
export const $measurementAdd = (params = {}) => {
  return $axios.get("/measurement/add", { params });
};
export const $measurementList = (params = {}) => {
  return $axios.get("/measurement/list", { params });
};
export const $measurementDetail = (params = {}) => {
  return $axios.get("/measurement/detail", { params });
};
export const $measurementEdit = (params = {}) => {
  return $axios.get("/measurement/edit", { params });
};
export const $measurementDel = (params = {}) => {
  return $axios.get("/measurement/del", { params });
};
